﻿using HY.Model;
using Microsoft.Extensions.Logging;

namespace HY.Service
{
    public class SysRoleService
    {
        public void UpdateRole(SysRole model)
        {
            using (var tran = DbContext.db.UseTran())
            {
                DbContext.db.Updateable(model).IgnoreColumns(it => new { it.AddTime }).ExecuteCommand();
                DbContext.db.Updateable<SysUser>().SetColumns(it => it.RoleName == model.RoleName).Where(it => it.RoleId == model.Id).ExecuteCommand();
                tran.CommitTran();
            }
        }
    }
}
